package admin

import (
	v1 "api/api/v1"
	"api/internal/model/entity"

	"github.com/gogf/gf/v2/frame/g"
)

// ArticleListReq 文章列表
type ArticleListReq struct {
	g.Meta `path:"/article/list" tags:"文章管理" method:"GET" summary:"文章列表" dc:"文章列表"`
	// 页码
	v1.PageReq
	Title   string `json:"title" dc:"标题"`
	Content string `json:"content" dc:"内容"`
	Status  string `json:"status" dc:"状态"`
}

// ArticleListRes 文章列表响应
type ArticleListRes struct {
	g.Meta `mime:"application/json" dc:"响应"`
	// 总数
	v1.ListRes
	List []*entity.Article `json:"list"`
}

// ArticleCreateReq 创建文章
type ArticleCreateReq struct {
	g.Meta  `path:"/article/create" tags:"文章管理" method:"POST" summary:"添加文章" dc:"添加文章"`
	Title   string `json:"title" v:"required#文章标题不能为空" dc:"文章标题"`
	Content string `json:"content" v:"required#文章内容不能为空" dc:"文章内容"`
	Status  uint   `json:"status" dc:"状态"`
}

// ArticleCreateRes 创建文章响应
type ArticleCreateRes struct {
}

// ArticleUpdateReq 编辑文章
type ArticleUpdateReq struct {
	g.Meta  `path:"/article/update" tags:"文章管理" method:"PUT" summary:"编辑文章" dc:"编辑文章信息"`
	Id      int64  `json:"id" v:"required#ID不能为空" dc:"岗位ID"`
	Title   string `json:"title" v:"required#文章标题不能为空" dc:"文章标题"`
	Content string `json:"content" v:"required#文章内容不能为空" dc:"文章内容"`
	Status  uint   `json:"status" dc:"状态"`
}

type ArticleUpdateRes struct {
}

type ArticleDeleteReq struct {
	g.Meta `path:"/article/delete" tags:"文章管理" method:"DELETE" summary:"删除文章" dc:"删除文章信息"`
	Ids    []int `json:"ids" v:"required#ID不能为空" dc:"文章ID"`
}

type ArticleDeleteRes struct {
}
